﻿using System;
using System.Linq;
using System.Linq.Expressions;

namespace DataAccess
{
    public interface IRepository<T>
          where T : class
    {
        IQueryable<T> All();
     
        IQueryable<T> Filter(Expression<Func<T, bool>> predicate);

        IQueryable<T> Filter(Expression<Func<T, bool>> predicate, string include);
     
        IQueryable<T> Filter(Expression<Func<T, bool>> filter, out int total, int index = 0, int size = 50);
        
        bool Contains(Expression<Func<T, bool>> predicate);
        
        T Find(params object[] keys);
        
        T Find(Expression<Func<T, bool>> predicate);

        T Find(Expression<Func<T, bool>> predicate, string include);
        
        T Create(T t);
        
        int Delete(T t);
        
        int Delete(Expression<Func<T, bool>> predicate);
        
        int Update(T t);
        
        int Count { get; }

        void Add(T t);

        void Edit(T t);

        void Remove(Expression<Func<T, bool>> predicate);

    }
}
